#ifndef REFINED_ABSTRACTION_H
#define REFINED_ABSTRACTION_H

#include"abstraction.h"
#include<iostream>
using namespace std;

//拉链式开关
class PullChainSwitch:public ISwitch{
public:
    PullChainSwitch(IElectricalEquipment*ee):ISwitch(ee){}

    ~PullChainSwitch(){
        cout<<"PullChainSwithch destory...."<<endl;
    }
    void on()override{
        cout << "Switch on the equipment with a pull chain switch." << std::endl;
        m_pEe->PowerOn();
    }
    void off()override{
        cout << "Switch off the equipment with a pull chain switch." << endl;
        m_pEe->PowerOff();
    }
};

// 两位开关
class TwoPositionSwitch : public ISwitch
{
public:
    TwoPositionSwitch(IElectricalEquipment *ee) : ISwitch(ee) {}
    ~TwoPositionSwitch(){
         cout<<"TwoPositionSwitch destory...."<<endl;
    }
    // 用两位开关打开电器
    void on() override {
        cout << "Switch on the equipment with a two-position switch." << endl;
        m_pEe->PowerOn();
    }

    // 用两位开关关闭电器
    void off() override {
        cout << "Switch off the equipment with a two-position switch." << endl;
        m_pEe->PowerOff();
    }
};





#endif // REFINED_ABSTRACTION_H
